package com.soccertgc.core.cards
{
	import com.soccertgc.core.TargetType;

	public class CardTargetInputFactory
	{
		
		protected static const 		JSON_PROPERTY_INPUT:String					= "input";
		protected static const 		JSON_PROPERTY_INPUT_TARGET:String			= "target";

		
		/**
		 * 
		 * @param type
		 * @param data
		 * @return 
		 */		
		public static function create(type:TargetType, data:Object):CardTargetInput
		{
			var targetInput:CardTargetInput;
			// Detect type
			switch(type)
			{
				case TargetType.NONE:
				{
					targetInput = CardTargetInput.NONE;
					break;
				}
					
				case TargetType.POSITION:
				{
					targetInput = new CardTargetInputRole(data);
					break;
				}
					
				case TargetType.EFFECT:
				{
					targetInput = new CardTargetInputEffect(data);
					break;
				}
					
				case TargetType.GRAVEYARD:
				{
					targetInput = new CardTargetInputGraveyard(data);
					break;
				}
			}
			return targetInput;
		}
		
	}
}